﻿/// <reference path="../GeneratedArtifacts/viewModel.js" />

myapp.AddEditMovement.beforeApplyChanges = function (screen) {
    // Write code here.


};
myapp.AddEditMovement.MovementType1_postRender = function (element, contentItem) {
    // Write code here.
    /*function updateTotal() {
        // Compute the total for the Order
        contentItem.screen.MovementType =
            TotalMovements(contentItem.screen.Movements, contentItem.screen.Movement.MovementDate);
    }
    // Set a dataBind to update the value when the collection changes
    contentItem.dataBind("screen.Movements.count", updateTotal)*/
};

/*// Function to compute the total for the Order 
function TotalMovements(OrderDetails, movedate) {
    // Start with 0
    var TotalAmountOfOrders = 0;
    // Get the data for the collection passed
    var OrderDetail = OrderDetails.data;
    // Loop through each row
    OrderDetail.forEach(function (order) {
        // Add each row to TotalAmountOfOrders
        if (movedate >= order.MovementDate)
        {
            TotalAmountOfOrders = order.MovementType.Id
        }
        
    });
    // Return TotalAmountOfOrders
    return TotalAmountOfOrders;
}*/